import React from 'react';
import { Route, IndexRoute } from 'react-router';
import Counter from './containers/Counter';
import Main from './containers/Main';
import Home from './containers/Home';

// 配置路由匹配信息，告诉路由如何根据URL来显示相应的子组件。
export default () => (
  // URL:'/'  跳转到组件 Main
  <Route path="/" component={Main}>
      {/*IndexRoute 组件将作为父级 Route 的默认子路由组件，也就是URL为/时显示的组件。*/}
    <IndexRoute component={Home} />
      {/*URL:'/Counter'  跳转到组件 Counter*/}
    <Route path="counter" component={Counter} />
  </Route>
);


// 路由配置信息如下:
//      URL             Components
//       /               Main -> Home
//    /Counter           Main -> Counter


